<template>
  <div>
    <h2>Footer</h2>
    <button @click="publish">把定价累加n</button>
  </div>
</template>

<script>
import pubsub from "pubsub-js";
export default {
  name: "Footer",
  methods: {
    publish() {
      //发送数据的一方就是发布者
      pubsub.publish("changePrice", 20);
    },
  },
};
</script>

<style></style>
